import axios from 'axios'


export const newsdetail=(data)=>{
    //console.log(data)
    return {
        type: 'NEWSDETAIL',
        payload:data
    }
}

export const NewsDetail=(id)=>{
    return (dispatch)=>{
        const url=`http://localhost:3000/news?id=${id}`
        /* const url=`http://203.195.241.213/news?id=${id}` */
        axios({
            url:url,
            method:"get"
        }).then(res=>{
            dispatch(newsdetail(res.data));
        })
    }
    
}